﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class map_map : System.Web.UI.Page
{
    string _op = "1";

    protected void Page_Load(object sender, EventArgs e)
    {
        var _x = Request.QueryString["x"] != null ? Request.QueryString["x"].ToString() : "115.475149";
        var _y = Request.QueryString["y"] != null ? string.IsNullOrEmpty(Request.QueryString["y"].ToString()) ? "38.869652" : Request.QueryString["y"].ToString() : "38.869652";
        _op = Request.QueryString["op"] != null ? string.IsNullOrEmpty(Request.QueryString["op"].ToString()) ? "1" : Request.QueryString["op"].ToString() : "1";

        if (_op == "2")
        {
            Response.Write("Save");
        }
        var _script = @"<script language='JavaScript'>var mapOptions = new MMapOptions();mapOptions.zoom = 15;mapOptions.center = new MLngLat(" + _x + ", " + _y + ");var mapObj = new MMap('mapObj', mapOptions);function getCenterByLatLng(event){var center = mapObj.getCenter();self.location = './map.aspx?x=' + center.lngX + '&y=' + center.latY + '&op=2';}</script>";
        lbl_Script.Text = _script;
    }
}
